package com.androidhive.musicplayer;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;


public class FirstScreenActivity extends Activity {
	// Initializing variables
	EditText name;
	public static String address;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.screen1);		
		
		name = (EditText) findViewById(R.id.name);
		
		Button btnNextScreen = (Button) findViewById(R.id.btnNextScreen);
		
		//Listening to button event
		btnNextScreen.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View arg0) {
				//Starting a new Intent
				FirstScreenActivity.address = name.getText().toString();
				Intent nextScreen = new Intent(getApplicationContext(), AndroidBuildingMusicPlayerActivity.class);
				startActivity(nextScreen);
			}
		});
	}
}